import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    {
        path: '/',
        component: () => import('../views/HomeView.vue'),
        redirect: '/index',
        children: [
            {
                path: '/index',
                component: () => import('../views/IndexView.vue')
            },
            {
                path: '/short_rent',
                component: () => import('../views/ShortRentView.vue')
            },
            {
                path: '/long_rent',
                component: () => import('../views/LongRentView.vue')
            },
            {
                path: '/car_owner',
                component: () => import('../views/CarOwnerView.vue')
            },
            {
                path: '/news',
                component: () => import('../views/NewsView.vue')
            },
            {
                path: '/center',
                component: () => import('../views/PersonalCenterView.vue')
            },
            {
                path: '/about',
                component: () => import('../views/AboutUs.vue'),
                children: [
                    {path: 'knowUs', component: () => import(/* webpackChunkName: "about" */ '../views/About/KnowUs.vue')},
                    {path: 'milestone', component: () => import(/* webpackChunkName: "about" */ '../views/About/Milestone.vue')},
                    {path: 'mediaReport', component: () => import(/* webpackChunkName: "about" */ '../views/About/MediaReport.vue')},
                    {path: 'rule', component: () => import(/* webpackChunkName: "about" */ '../views/About/Rule.vue')},
                    {path: 'leasingProcedures', component: () => import(/* webpackChunkName: "about" */ '../views/About/LeasingProcedures.vue')},
                    {path: 'insuranceClauses', component: () => import(/* webpackChunkName: "about" */ '../views/About/InsuranceClauses.vue')},
                    {path: 'ownersResAndIegal', component: () => import(/* webpackChunkName: "about" */ '../views/About/OwnersResAndIegal.vue')},
                    {path: 'vipServiceWeb', component: () => import(/* webpackChunkName: "about" */ '../views/About/VipServiceWeb.vue')},
                    {path: 'privacyPolicy', component: () => import(/* webpackChunkName: "about" */ '../views/About/PrivacyPolicy.vue')},
                ]
            },
            {
                path: '/signup',
                component: () => import('../views/SignupView.vue')
            },
            {
                path: '/long_rent/detail',
                component: () => import('../views/LongRentDetailView.vue')
            },
            {
                path: '/authentication',
                component: () => import('../views/About/Authentication.vue')
            },
            {
                path: '/topic',
                component: () => import('../views/Topic.vue')
            },
            {
                path: '/topic/1',
                component: () => import('../views/TopicDetailView.vue')
            }
        ]
    },
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
